import React from 'react'
import './index.less'

import { View, Text, Image } from "@tarojs/components";



class Intro extends React.PureComponent {

  constructor() {
    super(...arguments)
    this.state = {
      info: {}
    }
  }

  /* 数据更新时 */
  componentDidUpdate() {
    /* 接收项目信息 */
    this.setState({ info: this.props.projectDetailData })
  }

  render() {
    const { info } = this.state

    return (
      <View className='intro'>
        <Image
          src={info.cover_img_url}
          className='cover'
        />
        <View className='h3'>{info.title}</View>
        <View className='h4'>项目简介：{info.description}</View>
        <View className='h4'>培训类型：{info.classes}</View>
        <View className='h4'>培训讲师：{info.lecturer}</View>
        <View className='h4'>推荐难度：{info.level}</View>
        <View className='h4'>负责人：{info.principal}</View>
        <View className='h4'>截止时间：{info.end_time}</View>
      </View >
    )
  }
}

export default Intro